package com.qqtech.qquan.push.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.util.StringUtil;

@SuppressWarnings("serial")
public class PushLogVo extends PushLog {
	/** 信息类型:1-通知;2-自定义消息 **/
	private Integer type;
	/** 客户端类型:1-android;2-ios;3-全部 **/
	private Integer platform;
	private List<String> registrationIds;
	private List<String> alias;
	private List<String> tagValues;
	private List<String> tagAndValues;
	private Map<String, String> mapExtras;
	private String strRegistrationIds;
	private java.lang.String pushBizzName;
	private java.lang.String communityName;
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getPlatform() {
		return platform;
	}

	public void setPlatform(Integer platform) {
		this.platform = platform;
	}

	public List<String> getRegistrationIds() {
		return registrationIds;
	}

	public void setRegistrationIds(List<String> registrationIds) {
		this.registrationIds = registrationIds;
	}

	public List<String> getAlias() {
		return alias;
	}

	public void setAlias(List<String> alias) {
		this.alias = alias;
	}

	public List<String> getTagValues() {
		return tagValues;
	}

	public void setTagValues(List<String> tagValues) {
		this.tagValues = tagValues;
	}

	public List<String> getTagAndValues() {
		return tagAndValues;
	}

	public void setTagAndValues(List<String> tagAndValues) {
		this.tagAndValues = tagAndValues;
	}

	public Map<String, String> getMapExtras() {
		return mapExtras;
	}

	public void setMapExtras(Map<String, String> mapExtras) {
		if (mapExtras != null && StringUtil.isBlank(mapExtras.get("uuid"))) {
			mapExtras.put("uuid", StringUtil.uuidWithNo_());
		} else {
			mapExtras = new HashMap<String, String>();
			mapExtras.put("uuid", StringUtil.uuidWithNo_());
		}
		this.mapExtras = mapExtras;
	}

	public String getStrRegistrationIds() {
		return strRegistrationIds;
	}

	public void setStrRegistrationIds(String strRegistrationIds) {
		if (StringUtil.isNotBlank(strRegistrationIds)) {
			String[] ids = strRegistrationIds.split(";");
			if (ids != null && ids.length > 0) {
				if (this.registrationIds == null) {
					this.registrationIds = new ArrayList<String>(10);
				}
				for (String string : ids) {
					if (StringUtil.isNotBlank(string)) {
						this.registrationIds.add(string);
					}
				}
			}
		}
		this.strRegistrationIds = strRegistrationIds;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

	public java.lang.String getPushBizzName() {
		return pushBizzName;
	}

	public void setPushBizzName(java.lang.String pushBizzName) {
		this.pushBizzName = pushBizzName;
	}

	public java.lang.String getCommunityName() {
		return communityName;
	}

	public void setCommunityName(java.lang.String communityName) {
		this.communityName = communityName;
	}
}